package engine

type Hero struct {
	ID       int32
	Position int32
	HP       int
	Attack   int
	Speed    int
	Skills   []Skill
}

type Skill struct {
	ID       int32
	Name     string
	Damage   int
	CoolDown int
	Current  int // 当前冷却回合
}

func (h *Hero) canUseSkill() bool {
	for _, skill := range h.Skills {
		if skill.Current == 0 {
			return true
		}
	}
	return false
}

func (h *Hero) getAvailableSkill() *Skill {
	for i := range h.Skills {
		if h.Skills[i].Current == 0 {
			return &h.Skills[i]
		}
	}
	return nil
}

func (h *Hero) updateCoolDowns() {
	for i := range h.Skills {
		if h.Skills[i].Current > 0 {
			h.Skills[i].Current--
		}
	}
}
